blob: 19e5bde68e0f4382062ba2edb1f4dc60eff12074 [file] [log] [blame]
Edwin Kempind0a63922013-01-23 16:32:59 +01001Gerrit Code Review - '/changes/' REST API
2=========================================
3
4This page describes the change related REST endpoints.
5Please also take note of the general information on the
6link:rest-api.html[REST API].
7
8Endpoints
9---------
10
Edwin Kempin76202742013-02-15 13:51:50 +010011[[list-changes]]
Edwin Kempin82d30372013-02-04 08:49:34 +010012GET /changes/ (Query Changes)
13~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Edwin Kempind0a63922013-01-23 16:32:59 +010014Queries changes visible to the caller. The query string must be
15provided by the `q` parameter. The `n` parameter can be used to limit
16the returned results.
17
Edwin Kempine3446292013-02-19 16:40:14 +010018As result a list of link:#change-info[ChangeInfo] entries is returned.
19The change output is sorted by the last update time, most recently
20updated to oldest updated.
21
Edwin Kempind0a63922013-01-23 16:32:59 +010022Query for open changes of watched projects:
Edwin Kempin37440832013-02-06 11:36:00 +010023
24.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010025----
Edwin Kempin2091edb2013-01-23 19:07:38 +010026 GET /changes/?q=status:open+is:watched&n=2 HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010027----
Edwin Kempind0a63922013-01-23 16:32:59 +010028
Edwin Kempin37440832013-02-06 11:36:00 +010029.Response
30----
Edwin Kempind0a63922013-01-23 16:32:59 +010031 HTTP/1.1 200 OK
32 Content-Disposition: attachment
33 Content-Type: application/json;charset=UTF-8
34
35 )]}'
36 {
37 "kind": "gerritcodereview#change",
38 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
39 "project": "demo",
40 "branch": "master",
41 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
42 "subject": "One change",
43 "status": "NEW",
44 "created": "2012-07-17 07:18:30.854000000",
45 "updated": "2012-07-17 07:19:27.766000000",
46 "reviewed": true,
Edwin Kempindb1f0b82013-02-21 15:07:00 +010047 "mergeable": true,
Edwin Kempind0a63922013-01-23 16:32:59 +010048 "_sortkey": "001e7057000006dc",
49 "_number": 1756,
50 "owner": {
51 "name": "John Doe"
52 },
53 },
54 {
55 "kind": "gerritcodereview#change",
56 "id": "demo~master~I09c8041b5867d5b33170316e2abc34b79bbb8501",
57 "project": "demo",
58 "branch": "master",
59 "change_id": "I09c8041b5867d5b33170316e2abc34b79bbb8501",
60 "subject": "Another change",
61 "status": "NEW",
62 "created": "2012-07-17 07:18:30.884000000",
63 "updated": "2012-07-17 07:18:30.885000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +010064 "mergeable": true,
Edwin Kempind0a63922013-01-23 16:32:59 +010065 "_sortkey": "001e7056000006dd",
66 "_number": 1757,
67 "owner": {
68 "name": "John Doe"
69 },
70 "_more_changes": true
71 }
72----
73
Edwin Kempind0a63922013-01-23 16:32:59 +010074If the `n` query parameter is supplied and additional changes exist
75that match the query beyond the end, the last change object has a
76`_more_changes: true` JSON field set. Callers can resume a query with
Christian Aistleitner55364012013-02-17 12:18:22 +010077the `N` query parameter, supplying the last change's `_sortkey` field
78as the value. When going in the reverse direction with the `P` query
Edwin Kempind0a63922013-01-23 16:32:59 +010079parameter a `_more_changes: true` is put in the first change object if
80there are results *before* the first change returned.
81
82Clients are allowed to specify more than one query by setting the `q`
83parameter multiple times. In this case the result is an array of
84arrays, one per query in the same order the queries were given in.
85
Edwin Kempina64c4b92013-01-23 11:30:40 +010086.Query for the 25 most recent open changes of the projects that you watch
87****
88get::/changes/?q=status:open+is:watched&n=25
89****
90
Edwin Kempind0a63922013-01-23 16:32:59 +010091Query that retrieves changes for a user's dashboard:
Edwin Kempin37440832013-02-06 11:36:00 +010092
93.Request
Edwin Kempind0a63922013-01-23 16:32:59 +010094----
95 GET /changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +010096----
Edwin Kempind0a63922013-01-23 16:32:59 +010097
Edwin Kempin37440832013-02-06 11:36:00 +010098.Response
99----
Edwin Kempind0a63922013-01-23 16:32:59 +0100100 HTTP/1.1 200 OK
101 Content-Disposition: attachment
102 Content-Type: application/json;charset=UTF-8
103
104 )]}'
105 [
106 [
107 {
108 "kind": "gerritcodereview#change",
109 "id": "demo~master~Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
110 "project": "demo",
111 "branch": "master",
112 "change_id": "Idaf5e098d70898b7119f6f4af5a6c13343d64b57",
113 "subject": "One change",
114 "status": "NEW",
115 "created": "2012-07-17 07:18:30.854000000",
116 "updated": "2012-07-17 07:19:27.766000000",
117 "reviewed": true,
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100118 "mergeable": true,
Edwin Kempind0a63922013-01-23 16:32:59 +0100119 "_sortkey": "001e7057000006dc",
120 "_number": 1756,
121 "owner": {
122 "name": "John Doe"
123 },
124 "labels": {
125 "Verified": {},
126 "Code-Review": {}
127 }
128 }
129 ],
130 [],
131 []
132 ]
133----
134
Edwin Kempina64c4b92013-01-23 11:30:40 +0100135.Query the changes for your user dashboard
136****
137get::/changes/?q=is:open+owner:self&q=is:open+reviewer:self+-owner:self&q=is:closed+owner:self+limit:5&o=LABELS
138****
139
Edwin Kempind0a63922013-01-23 16:32:59 +0100140Additional fields can be obtained by adding `o` parameters, each
141option requires more database lookups and slows down the query
142response time to the client so they are generally disabled by
143default. Optional fields are:
144
Edwin Kempine3446292013-02-19 16:40:14 +0100145[[labels]]
146--
Edwin Kempind0a63922013-01-23 16:32:59 +0100147* `LABELS`: a summary of each label required for submit, and
148 approvers that have granted (or rejected) with that label.
Edwin Kempine3446292013-02-19 16:40:14 +0100149--
Edwin Kempind0a63922013-01-23 16:32:59 +0100150
Edwin Kempine3446292013-02-19 16:40:14 +0100151[[detailed-labels]]
152--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800153* `DETAILED_LABELS`: detailed label information, including numeric
Dave Borowitz992ddd72013-02-13 11:53:17 -0800154 values of all existing approvals, recognized label values, values
155 permitted to be set by the current user, and reviewers that may be
156 removed by the current user.
Edwin Kempine3446292013-02-19 16:40:14 +0100157--
Dave Borowitz4c7231a2013-01-30 16:18:59 -0800158
Edwin Kempine3446292013-02-19 16:40:14 +0100159[[current-revision]]
160--
Edwin Kempind0a63922013-01-23 16:32:59 +0100161* `CURRENT_REVISION`: describe the current revision (patch set)
162 of the change, including the commit SHA-1 and URLs to fetch from.
Edwin Kempine3446292013-02-19 16:40:14 +0100163--
Edwin Kempind0a63922013-01-23 16:32:59 +0100164
Edwin Kempine3446292013-02-19 16:40:14 +0100165[[all-revisions]]
166--
Edwin Kempind0a63922013-01-23 16:32:59 +0100167* `ALL_REVISIONS`: describe all revisions, not just current.
Edwin Kempine3446292013-02-19 16:40:14 +0100168--
Edwin Kempind0a63922013-01-23 16:32:59 +0100169
Edwin Kempine3446292013-02-19 16:40:14 +0100170[[current-commit]]
171--
Edwin Kempind0a63922013-01-23 16:32:59 +0100172* `CURRENT_COMMIT`: parse and output all header fields from the
173 commit object, including message. Only valid when the current
174 revision or all revisions are selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100175--
Edwin Kempind0a63922013-01-23 16:32:59 +0100176
Edwin Kempine3446292013-02-19 16:40:14 +0100177[[all-commits]]
178--
Edwin Kempind0a63922013-01-23 16:32:59 +0100179* `ALL_COMMITS`: parse and output all header fields from the
180 output revisions. If only `CURRENT_REVISION` was requested
181 then only the current revision's commit data will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100182--
Edwin Kempind0a63922013-01-23 16:32:59 +0100183
Edwin Kempine3446292013-02-19 16:40:14 +0100184[[current-files]]
185--
Edwin Kempind0a63922013-01-23 16:32:59 +0100186* `CURRENT_FILES`: list files modified by the commit, including
187 basic line counts inserted/deleted per file. Only valid when
188 the current revision or all revisions are selected.
Edwin Kempine3446292013-02-19 16:40:14 +0100189--
Edwin Kempind0a63922013-01-23 16:32:59 +0100190
Edwin Kempine3446292013-02-19 16:40:14 +0100191[[all-files]]
192--
Edwin Kempind0a63922013-01-23 16:32:59 +0100193* `ALL_FILES`: list files modified by the commit, including
194 basic line counts inserted/deleted per file. If only the
195 `CURRENT_REVISION` was requested the only that commit's
196 modified files will be output.
Edwin Kempine3446292013-02-19 16:40:14 +0100197--
Edwin Kempind0a63922013-01-23 16:32:59 +0100198
Edwin Kempine3446292013-02-19 16:40:14 +0100199[[detailed-accounts]]
200--
Dave Borowitz8926a882013-02-01 14:32:48 -0800201* `DETAILED_ACCOUNTS`: include `_account_id` and `email` fields when
202 referencing accounts.
Edwin Kempine3446292013-02-19 16:40:14 +0100203--
Dave Borowitz8926a882013-02-01 14:32:48 -0800204
Edwin Kempin37440832013-02-06 11:36:00 +0100205.Request
Edwin Kempind0a63922013-01-23 16:32:59 +0100206----
207 GET /changes/?q=97&o=CURRENT_REVISION&o=CURRENT_COMMIT&o=CURRENT_FILES HTTP/1.0
Edwin Kempin37440832013-02-06 11:36:00 +0100208----
Edwin Kempind0a63922013-01-23 16:32:59 +0100209
Edwin Kempin37440832013-02-06 11:36:00 +0100210.Response
211----
Edwin Kempind0a63922013-01-23 16:32:59 +0100212 HTTP/1.1 200 OK
213 Content-Disposition: attachment
214 Content-Type: application/json;charset=UTF-8
215
216 )]}'
217 [
218 {
219 "kind": "gerritcodereview#change",
220 "id": "demo~master~I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
221 "project": "gerrit",
222 "branch": "master",
223 "change_id": "I7ea46d2e2ee5c64c0d807677859cfb7d90b8966a",
224 "subject": "Use an EventBus to manage star icons",
225 "status": "NEW",
226 "created": "2012-04-25 00:52:25.580000000",
227 "updated": "2012-04-25 00:52:25.586000000",
Edwin Kempindb1f0b82013-02-21 15:07:00 +0100228 "mergeable": true,
Edwin Kempind0a63922013-01-23 16:32:59 +0100229 "_sortkey": "001c9bf400000061",
230 "_number": 97,
231 "owner": {
232 "name": "Shawn Pearce"
233 },
234 "current_revision": "184ebe53805e102605d11f6b143486d15c23a09c",
235 "revisions": {
236 "184ebe53805e102605d11f6b143486d15c23a09c": {
237 "_number": 1,
238 "fetch": {
239 "git": {
240 "url": "git://localhost/gerrit",
241 "ref": "refs/changes/97/97/1"
242 },
243 "http": {
244 "url": "http://127.0.0.1:8080/gerrit",
245 "ref": "refs/changes/97/97/1"
246 }
247 },
248 "commit": {
249 "parents": [
250 {
251 "commit": "1eee2c9d8f352483781e772f35dc586a69ff5646",
252 "subject": "Migrate contributor agreements to All-Projects."
253 }
254 ],
255 "author": {
256 "name": "Shawn O. Pearce",
257 "email": "sop@google.com",
258 "date": "2012-04-24 18:08:08.000000000",
259 "tz": -420
260 },
261 "committer": {
262 "name": "Shawn O. Pearce",
263 "email": "sop@google.com",
264 "date": "2012-04-24 18:08:08.000000000",
265 "tz": -420
266 },
267 "subject": "Use an EventBus to manage star icons",
268 "message": "Use an EventBus to manage star icons\n\nImage widgets that need to ..."
269 },
270 "files": {
271 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeCache.java": {
272 "lines_deleted": 8
273 },
274 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeDetailCache.java": {
275 "lines_inserted": 1
276 },
277 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeScreen.java": {
278 "lines_inserted": 11,
279 "lines_deleted": 19
280 },
281 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/ChangeTable.java": {
282 "lines_inserted": 23,
283 "lines_deleted": 20
284 },
285 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarCache.java": {
286 "status": "D",
287 "lines_deleted": 139
288 },
289 "gerrit-gwtui/src/main/java/com/google/gerrit/client/changes/StarredChanges.java": {
290 "status": "A",
291 "lines_inserted": 204
292 },
293 "gerrit-gwtui/src/main/java/com/google/gerrit/client/ui/Screen.java": {
294 "lines_deleted": 9
295 }
296 }
297 }
298 }
299 }
300 ]
301----
302
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100303[[get-change]]
304GET /changes/\{change-id\} (Get Change)
305~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
306Retrieves a change.
307
308.Request
309----
310 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940 HTTP/1.0
311----
312
313As response a link:#change-info[ChangeInfo] entity is returned that
314describes the change.
315
316.Response
317----
318 HTTP/1.1 200 OK
319 Content-Disposition: attachment
320 Content-Type: application/json;charset=UTF-8
321
322 )]}'
323 {
324 "kind": "gerritcodereview#change",
325 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
326 "project": "myProject",
327 "branch": "master",
328 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
329 "subject": "Implementing Feature X",
330 "status": "NEW",
331 "created": "2013-02-01 09:59:32.126000000",
332 "updated": "2013-02-21 11:16:36.775000000",
333 "reviewed": true,
334 "mergeable": true,
335 "_sortkey": "0023412400000f7d",
336 "_number": 3965,
337 "owner": {
338 "name": "John Doe"
339 }
340 }
341----
342
Edwin Kempin8e492202013-02-21 15:38:25 +0100343[[get-change-detail]]
344GET /changes/\{change-id\}/detail (Get Change Detail)
345~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
346Retrieves a change with link:#labels[labels], link:#detailed-labels[
347detailed labels] and link:#detailed-accounts[detailed accounts].
348
349.Request
350----
351 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/detail HTTP/1.0
352----
353
354As response a link:#change-info[ChangeInfo] entity is returned that
355describes the change.
356
357.Response
358----
359 HTTP/1.1 200 OK
360 Content-Disposition: attachment
361 Content-Type: application/json;charset=UTF-8
362
363 )]}'
364 {
365 "kind": "gerritcodereview#change",
366 "id": "myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940",
367 "project": "myProject",
368 "branch": "master",
369 "change_id": "I8473b95934b5732ac55d26311a706c9c2bde9940",
370 "subject": "Implementing Feature X",
371 "status": "NEW",
372 "created": "2013-02-01 09:59:32.126000000",
373 "updated": "2013-02-21 11:16:36.775000000",
374 "reviewed": true,
375 "mergeable": true,
376 "_sortkey": "0023412400000f7d",
377 "_number": 3965,
378 "owner": {
379 "_account_id": 1000096,
380 "name": "John Doe",
381 "email": "john.doe@example.com"
382 },
383 "labels": {
384 "Verified": {
385 "all": [
386 {
387 "value": 0,
388 "_account_id": 1000096,
389 "name": "John Doe",
390 "email": "john.doe@example.com"
391 },
392 {
393 "value": 0,
394 "_account_id": 1000097,
395 "name": "Jane Roe",
396 "email": "jane.roe@example.com"
397 }
398 ],
399 "values": {
400 "-1": "Fails",
401 " 0": "No score",
402 "+1": "Verified"
403 }
404 },
405 "Code-Review": {
406 "recommended": {
407 "_account_id": 1000097,
408 "name": "Jane Roe",
409 "email": "jane.roe@example.com"
410 },
411 "disliked": {
412 "_account_id": 1000096,
413 "name": "John Doe",
414 "email": "john.doe@example.com"
415 },
416 "all": [
417 {
418 "value": -1,
419 "_account_id": 1000096,
420 "name": "John Doe",
421 "email": "john.doe@example.com"
422 },
423 {
424 "value": 1,
425 "_account_id": 1000097,
426 "name": "Jane Roe",
427 "email": "jane.roe@example.com"
428 }
429 ]
430 "values": {
431 "-2": "Do not submit",
432 "-1": "I would prefer that you didn\u0027t submit this",
433 " 0": "No score",
434 "+1": "Looks good to me, but someone else must approve",
435 "+2": "Looks good to me, approved"
436 }
437 }
438 },
439 "permitted_labels": {
440 "Verified": [
441 "-1",
442 " 0",
443 "+1"
444 ],
445 "Code-Review": [
446 "-2",
447 "-1",
448 " 0",
449 "+1",
450 "+2"
451 ]
452 },
453 "removable_reviewers": [
454 {
455 "_account_id": 1000096,
456 "name": "John Doe",
457 "email": "john.doe@example.com"
458 },
459 {
460 "_account_id": 1000097,
461 "name": "Jane Roe",
462 "email": "jane.roe@example.com"
463 }
464 ]
465 }
466----
467
Edwin Kempin64006bb2013-02-22 08:17:04 +0100468[[get-topic]]
469GET /changes/\{change-id\}/topic (Get Topic)
470~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
471Retrieves the topic of a change.
472
473.Request
474----
475 GET /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
476----
477
478.Response
479----
480 HTTP/1.1 200 OK
481 Content-Disposition: attachment
482 Content-Type: application/json;charset=UTF-8
483
484 )]}'
485 "Documentation"
486----
487
488If the change does not have a topic an empty string is returned.
489
490[[set-topic]]
491PUT /changes/\{change-id\}/topic (Set Topic)
492~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
493Sets the topic of a change.
494
495The new topic must be provided in the request body inside a
496link:#topic-input[TopicInput] entity.
497
498.Request
499----
500 PUT /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
501 Content-Type: application/json;charset=UTF-8
502
503 {
504 "topic": "Documentation"
505 }
506----
507
508As response the new topic is returned.
509
510.Response
511----
512 HTTP/1.1 200 OK
513 Content-Disposition: attachment
514 Content-Type: application/json;charset=UTF-8
515
516 )]}'
517 "Documentation"
518----
519
520If the topic was deleted the response is "`204 No Content`".
521
522[[delete-topic]]
523DELETE /changes/\{change-id\}/topic (Delete Topic)
524~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
525Deletes the topic of a change.
526
527The request body does not need to include a link:#topic-input[
528TopicInput] entity if no review comment is added.
529
530Please note that some proxies prohibit request bodies for DELETE
531requests. In this case, if you want to specify a commit message, use
532link:#set-topic[PUT] to delete the topic.
533
534.Request
535----
536 DELETE /changes/myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940/topic HTTP/1.0
537----
538
539.Response
540----
541 HTTP/1.1 204 No Content
542----
543
Edwin Kempinff9e6e32013-02-21 13:07:11 +0100544
545[[ids]]
546IDs
547---
548
549[[change-id]]
550\{change-id\}
551~~~~~~~~~~~~~
552Identifier that uniquely identifies one change.
553
554This can be:
555
556* an ID of the change in the format "'$$<project>~<branch>~<Change-Id>$$'",
557 where for the branch the `refs/heads/` prefix can be omitted
558 ("$$myProject~master~I8473b95934b5732ac55d26311a706c9c2bde9940$$")
559* a Change-Id if it uniquely identifies one change
560 ("I8473b95934b5732ac55d26311a706c9c2bde9940")
561* a legacy numeric change ID ("4247")
562
563
Edwin Kempine3446292013-02-19 16:40:14 +0100564[[json-entities]]
565JSON Entities
566-------------
567
568[[account-info]]
569AccountInfo
570~~~~~~~~~~~
571The `AccountInfo` entity contains information about an account.
572
573[options="header",width="50%",cols="1,^1,5"]
574|===========================
575|Field Name ||Description
576|`_account_id` ||The numeric ID of the account.
577|`name` |optional|The full name of the user. +
578Only set if link:#detailed-accounts[detailed account information] is
579requested.
580|`email` |optional|
581The email address the user prefers to be contacted through. +
582Only set if link:#detailed-accounts[detailed account information] is
583requested.
584|===========================
585
586[[approval-info]]
587ApprovalInfo
588~~~~~~~~~~~~
589The `ApprovalInfo` entity contains information about an approval from a
590user for a label on a change.
591
592`ApprovalInfo` has the same fields as link:#account-info[AccountInfo].
593In addition `ApprovalInfo` has the following fields:
594
595[options="header",width="50%",cols="1,^1,5"]
596|===========================
597|Field Name ||Description
598|`value` ||The vote that the user has given for the label.
599|===========================
600
601[[change-info]]
602ChangeInfo
603~~~~~~~~~~
604The `ChangeInfo` entity contains information about a change.
605
606[options="header",width="50%",cols="1,^1,5"]
607|==================================
608|Field Name ||Description
609|`kind` ||`gerritcodereview#change`
610|`id` ||
611The ID of the change in the format "'<project>\~<branch>~<Change-Id>'",
612where project, branch and Change-Id are URL encoded. For branch the
613`refs/heads/` prefix is omitted.
614|`project` ||The name of the project.
615|`branch` ||
616The name of the target branch. +
617The `refs/heads/` prefix is omitted.
Edwin Kempincd6c01a12013-02-21 14:58:52 +0100618|`topic` |optional|The topic to which this change belongs.
Edwin Kempine3446292013-02-19 16:40:14 +0100619|`change_id` ||The Change-Id of the change.
620|`subject` ||
621The subject of the change (header line of the commit message).
622|`status` ||
623The status of the change (`NEW`, `SUBMITTED`, `MERGED`, `ABANDONED`,
624`DRAFT`).
625|`created` ||
626The link:rest-api.html#timestamp[timestamp] of when the change was
627created.
628|`updated` ||
629The link:rest-api.html#timestamp[timestamp] of when the change was last
630updated.
631|`starred` |not set if `false`|
632Whether the calling user has starred this change.
633|`reviewed` |not set if `false`|
634Whether the change was reviewed by the calling user.
635|`mergeable` ||Whether the change is mergeable.
636|`_sortkey` ||The sortkey of the change.
637|`_number` ||The legacy numeric ID of the change.
638|`owner` ||
639The owner of the change as an link:#account-info[AccountInfo] entity.
640|`labels` |optional|
641The labels of the change as a map that maps the label names to
642link:#label-info[LabelInfo] entries. +
643Only set if link:#labels[labels] or link:#detailed-labels[detailed
644labels] are requested.
645|`permitted_labels` |optional|
646A map of the permitted labels that maps a label name to the list of
647values that are allowed for that label. +
648Only set if link:#detailed-labels[detailed labels] are requested.
649|`removable_reviewers`|optional|
650The reviewers that can be removed by the calling user as a list of
651link:#account-info[AccountInfo] entities. +
652Only set if link:#detailed-labels[detailed labels] are requested.
653|`current_revision` |optional|
654The commit ID of the current patch set of this change. +
655Only set if link:#current-revision[the current revision] is requested
656or if link:#all-revisions[all revisions] are requested.
657|`revisions` |optional|
658All patch sets of this changes as a map that maps the commit ID of the
659patch set to a link:#revision-info[RevisionInfo] entity. +
660Only set if link:#all-revisions[all revisions] are requested.
661|`_more_changes` |optional, not set if `false`|
662Whether the query would deliver more results if not limited. +
663Only set on either the last or the first change that is returned.
664|==================================
665
666[[commit-info]]
667CommitInfo
668~~~~~~~~~~
669The `CommitInfo` entity contains information about a commit.
670
671[options="header",width="50%",cols="1,6"]
672|==========================
673|Field Name |Description
674|`commit` |The commit ID.
675|`parent` |
676The parent commits of this commit as a list of
677link:#commit-info[CommitInfo] entities.
678|`author` |The author of the commit as a
679link:#git-person-info[GitPersonInfo] entity.
680|`committer` |The committer of the commit as a
681link:#git-person-info[GitPersonInfo] entity.
682|`subject` |
683The subject of the commit (header line of the commit message).
684|`message` |The commit message.
685|==========================
686
687[[fetch-info]]
688FetchInfo
689~~~~~~~~~
690The `FetchInfo` entity contains information about how to fetch a patch
691set via a certain protocol.
692
693[options="header",width="50%",cols="1,6"]
694|==========================
695|Field Name |Description
696|`url` |The URL of the project.
697|`ref` |The ref of the patch set.
698|==========================
699
700[[file-info]]
701FileInfo
702~~~~~~~~
703The `FileInfo` entity contains information about a file in a patch set.
704
705[options="header",width="50%",cols="1,^1,5"]
706|=============================
707|Field Name ||Description
708|`status` |optional|
709The status of the file ("`A`"=Added, "`D`"=Deleted, "`R`"=Renamed,
710"`C`"=Copied, "`W`"=Rewritten). +
711Not set if the file was Modified ("`M`").
712|`binary` |not set if `false`|Whether the file is binary.
713|`old_path` |optional|
714The old file path. +
715Only set if file was renamed or copied.
716|`lines_inserted`|optional|
717Number of inserted lines. +
718Not set for binary files or if no lines were inserted.
719|`lines_deleted` |optional|
720Number of deleted lines. +
721Not set for binary files or if no lines were deleted.
722|=============================
723
724[[git-person-info]]
725GitPersonInfo
726~~~~~~~~~~~~~
727The `GitPersonInfo` entity contains information about the
728author/committer of a commit.
729
730[options="header",width="50%",cols="1,6"]
731|==========================
732|Field Name |Description
733|`name` |The name of the author/committer.
734|`email` |The email address of the author/committer.
735|`date` |The link:rest-api.html#timestamp[timestamp] of when
736this identity was constructed.
737|`tz` |The timezone offset from UTC of when this identity was
738constructed.
739|==========================
740
741[[label-info]]
742LabelInfo
743~~~~~~~~~
744The `LabelInfo` entity contains information about a label on a change.
745
746[options="header",width="50%",cols="1,^1,5"]
747|===========================
748|Field Name ||Description
749|`approved` |optional|The user who approved this label on the change
750as a link:#account-info[AccountInfo] entity. +
751Only set if link:#labels[labels] are requested.
752|`rejected` |optional|The user who rejected this label on the change
753as a link:#account-info[AccountInfo] entity. +
754Only set if link:#labels[labels] are requested.
755|`recommended` |optional|The user who recommended this label on the
756change as a link:#account-info[AccountInfo] entity. +
757Only set if link:#labels[labels] are requested.
758|`disliked` |optional|The user who disliked this label on the change
759as a link:#account-info[AccountInfo] entity. +
760Only set if link:#labels[labels] are requested.
761|`value` |optional|The voting value of the user who
762recommended/disliked this label on the change if it is not
763"`+1`"/"`-1`". +
764Only set if link:#labels[labels] are requested.
765|`optional` |not set if `false`|
766Whether the label is optional. Optional means the label may be set, but
767it's neither necessary for submission nor does it block submission if
768set.
769|`all` |optional|List of all approvals for this label as a list
770of link:#approval-info[ApprovalInfo] entities. +
771Only set if link:#detailed-labels[detailed labels] are requested.
772|`values` |optional|A map of all values that are allowed for this
773label. The map maps the values ("`-2`", "`-1`", " `0`", "`+1`", "`+2`")
774to the value descriptions. +
775Only set if link:#detailed-labels[detailed labels] are requested.
776|===========================
777
778[[revision-info]]
779RevisionInfo
780~~~~~~~~~~~~
781The `RevisionInfo` entity contains information about a patch set.
782
783[options="header",width="50%",cols="1,^1,5"]
784|===========================
785|Field Name ||Description
786|`draft` |not set if `false`|Whether the patch set is a draft.
787|`_number` ||The patch set number.
788|`fetch` ||
789Information about how to fetch this patch set. The fetch information is
790provided as a map that maps the protocol name ("`git`", "`http`",
791"`ssh`") to link:#fetch-info[FetchInfo] entities.
792|`commit` ||The commit of the patch set as
793link:#commit-info[CommitInfo] entity.
794|`files` ||
795The files of the patch set as a map that maps the file names to
796link:#file-info[FileInfo] entities.
797|===========================
798
Edwin Kempin64006bb2013-02-22 08:17:04 +0100799[[topic-input]]
800TopicInput
801~~~~~~~~~~
802The `TopicInput` entity contains information for setting a topic.
803
804[options="header",width="50%",cols="1,^1,5"]
805|===========================
806|Field Name ||Description
807|`topic` |optional|The topic. +
808The topic will be deleted if not set.
809|`message` |optional|
810Message to be added as review comment to the change when setting the
811topic.
812|===========================
813
Edwin Kempind0a63922013-01-23 16:32:59 +0100814
815GERRIT
816------
817Part of link:index.html[Gerrit Code Review]